package cn.iocoder.yudao.module.kt.dal.mysql.digitalimg;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.kt.dal.dataobject.digitalimg.DigitalImgDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.kt.controller.admin.digitalimg.vo.*;

/**
 * 数字人形象管理 Mapper
 *
 * @author zhaokang
 */
@Mapper
public interface DigitalImgMapper extends BaseMapperX<DigitalImgDO> {

    default PageResult<DigitalImgDO> selectPage(DigitalImgPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DigitalImgDO>()
                .likeIfPresent(DigitalImgDO::getName, reqVO.getName())
                .eqIfPresent(DigitalImgDO::getSort, reqVO.getSort())
                .betweenIfPresent(DigitalImgDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DigitalImgDO::getType, reqVO.getType())
                .eqIfPresent(DigitalImgDO::getPicBg, reqVO.getPicBg())
                .eqIfPresent(DigitalImgDO::getVedioBg, reqVO.getVedioBg())
                .orderByDesc(DigitalImgDO::getId));
    }

}